import React, { memo } from 'react'
import { Outlet, ScrollRestoration } from 'react-router-dom'
import Header from './components/header'
import Footer from './components/footer'

const App = memo(() => {
  // useScrollTop()
  return (
    <div>
      <Header/>
      <Outlet/>
      <Footer/>
      <ScrollRestoration
        getKey={(location, matches) => {
          /* 打开1 打开2 再点击回1(不是点返回)恢复原本浏览位置  */
          // return location.pathname
        return location.key;
       }}
      />
    </div>
  )
})

export default App